package com.presalept.manipulatedata;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import com.mysql.jdbc.Driver;

public class DbManager {
	
	public static Connection getConnection() throws SQLException{
		return getConnection("developmentdb01", "presaledb_01", "qazWSX0987654321");
	}
	
	public static Connection getConnection(String dbName, String userName, String password) throws SQLException{
		
		String url = "jdbc:mysql://presale01.mysql.rds.aliyuncs.com:3306/" + dbName + "?useUnicode=true&characterEncoding=UTF-8";
		
		DriverManager.registerDriver(new Driver());
		
		return DriverManager.getConnection(url, userName, password);
		
	}
}
